<?php /*a:1:{s:75:"E:\phpstudy\PHPTutorial\WWW\adminluyu\application\admin\view\menu\form.html";i:1559201456;}*/ ?>
<div class="weadmin-body">
    <form class="layui-form" data-form='<?php echo request()->url(); ?>'>
        <div class="layui-form-item">
            <label for="title" class="layui-form-label">
                <span class="we-red">*</span>菜单名称
            </label>
            <div class="layui-input-inline">
                <input type="text" id="title" name="title" required="" lay-verify="required"
                       value="<?php echo htmlentities((isset($vo['title']) && ($vo['title'] !== '')?$vo['title']:'')); ?>" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label for="title" class="layui-form-label">
                <span class="we-red">*</span>排序
            </label>
            <div class="layui-input-inline">
                <input type="text" id="sort" name="sort" required="" lay-verify="required"
                       value="<?php echo htmlentities((isset($vo['sort']) && ($vo['sort'] !== '')?$vo['sort']:'50')); ?>" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="we-red">*</span>影响菜单顺序
            </div>
        </div>

        <div class="layui-form-item">
            <label for="pid" class="layui-form-label">
                <span class="we-red">*</span>上级菜单
            </label>
            <div class="layui-input-inline">
                <select name="pid" id="pid" lay-verify="required">
                    <option value="0">顶级菜单</option>
                    <?php if(is_array($parents) || $parents instanceof \think\Collection || $parents instanceof \think\Paginator): $i = 0; $__LIST__ = $parents;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$parent): $mod = ($i % 2 );++$i;?>
                    <option value="<?php echo htmlentities($parent['id']); ?>" <?php if(((isset($vo['pid'])) AND ($vo['pid'] == $parent['id'])) OR (isset($pid) AND ($pid == $parent['id']))): ?>selected<?php endif; ?>>
                    <?php echo htmlentities($parent['_pre']); ?><?php echo htmlentities($parent['title']); ?>
                    </option>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label for="url" class="layui-form-label">
                <span class="we-red">*</span>链接地址
            </label>
            <div class="layui-input-block">
                <input type="text" value="<?php echo htmlentities((isset($vo['url']) && ($vo['url'] !== '')?$vo['url']:'#')); ?>" id="url" name="url" required=""
                       class="layui-input">
            </div>
        </div>

        <div class="layui-form-item layui-hide">
            <input name="icon" value="">
        </div>

        <div class="layui-form-item layui-col-xs10 layui-col-xs-offset2">
            <?php if(isset($vo['id'])): ?><input type="hidden" name="id" value="<?php echo htmlentities($vo['id']); ?>"><?php endif; ?>
            <button class="layui-btn" lay-submit="">确定</button>
        </div>
    </form>
</div>

<script>
    layui.use('form',function () {
        layui.form.render();
    })
</script>